package cn.raths.feign;

import cn.raths.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        return id -> {
            throwable.printStackTrace();
            return new User(-1L,"","降级类");
        };
    }
}
